Imports System.ComponentModel
Imports FluentValidation
Imports FluentValidation.Attributes
Imports System.ComponentModel.DataAnnotations

<MetadataType(GetType(PersonaMetadata))>
Public MustInherit Class Persona

    ReadOnly Property NombreCompleto() As String
        Get
            If String.IsNullOrEmpty(Nombre) Then
                Return String.Format("{0}{1}", Apellido1, If(String.IsNullOrEmpty(Apellido2), "", " " & Apellido2))
            Else
                Return String.Format("{1}{2}, {0}", Nombre, Apellido1, If(String.IsNullOrEmpty(Apellido2), "", " " & Apellido2))
            End If
        End Get
    End Property

    ReadOnly Property NombreCompletoDerecho() As String
        Get
            Return String.Format("{0} {1} {2}", Nombre, Apellido1, Apellido2).Trim
        End Get
    End Property

    MustOverride Function NombreEntidad() As String

End Class
